Skip to content

update logging for jobmanager. #2854

Merged
sawka merged 1 commit intomainfrom
sawka/jobmanager-logging
Feb 11, 2026
Merged

update logging for jobmanager. #2854
sawka merged 1 commit intomainfrom
sawka/jobmanager-logging

Conversation

@sawka
Copy link
Member

@sawka sawka commented Feb 11, 2026

one directory, prune files in connserver, write keepalives every hour. remove senddata log line.

…er, write keepalives every hour. remove senddata log line.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Walkthrough

The PR implements job log retention and cleanup mechanisms for the connection server, refactors job path utilities from the jobmanager package to the wavebase package, and introduces minor adjustments to job management workflows. New cleanup scheduling logic and keepalive telemetry are added to manage job logs, while path resolution functions are centralized into wavebase utilities. Timestamp rounding for telemetry events is adjusted from 2-hour to 1-hour intervals. Public API functions are removed from jobmanager and replaced with new centralized functions in wavebase.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'update logging for jobmanager' directly relates to the PR's primary objective of consolidating logging and improving log management for the job manager system.
Description check ✅ Passed The description 'one directory, prune files in connserver, write keepalives every hour. remove senddata log line' accurately reflects the main changes: consolidating logging, adding log cleanup, adding keepalive logging, and removing a log line.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sawka/jobmanager-logging

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
pkg/jobmanager/mainserverconn.go (1)

45-46: Commented-out code left in place.

Consider removing the commented-out log line entirely rather than leaving it as dead code. If needed for future debugging, it can be recovered from version control.

pkg/wavebase/wavebase.go (1)

439-443: filepath.Join produces OS-specific paths, but functions are documented as "remote" (Unix) paths.

These functions use filepath.Join, which uses backslashes on Windows. Since they're labeled "on remote machine" (implying Unix), if these are ever called from a Windows client to compute a remote path, the result would be incorrect. Currently all call sites run on Unix, so this is safe today — just worth noting for future maintainers.

Also, MakeJobDomainSocket in pkg/jobmanager/jobmanager.go (line 380) independently computes the same socketDir. Consider having it call GetRemoteJobSocketPath for the full path to avoid duplication (it already does at line 386 for socketPath, but still computes socketDir separately for MkdirAll).

pkg/jobmanager/jobmanager.go (1)

379-386: Socket directory computed twice — once locally, once via wavebase.

Line 380 computes socketDir inline, while line 386 calls wavebase.GetRemoteJobSocketPath(jobId) which also computes the same directory internally. Consider extracting a helper or reusing the wavebase path for MkdirAll as well.

♻️ Suggested simplification
 func MakeJobDomainSocket(clientId string, jobId string) error {
-	socketDir := filepath.Join("/tmp", fmt.Sprintf("waveterm-%d", os.Getuid()))
-	err := os.MkdirAll(socketDir, 0700)
+	socketPath := wavebase.GetRemoteJobSocketPath(jobId)
+	socketDir := filepath.Dir(socketPath)
+	err := os.MkdirAll(socketDir, 0700)
 	if err != nil {
 		return fmt.Errorf("failed to create socket directory: %w", err)
 	}
 
-	socketPath := wavebase.GetRemoteJobSocketPath(jobId)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sawka sawka merged commit 9ea1d24 into main Feb 11, 2026
7 checks passed
@sawka sawka deleted the sawka/jobmanager-logging branch February 11, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant